package View;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class TelaPrincipal {

	private JPanel contentPane;
	private static JFrame janela;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TelaPrincipal frame = new TelaPrincipal();
					janela.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public TelaPrincipal() {
		janela = new JFrame ("Menu Inicial");
		janela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		janela.setSize(600,400);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		janela.setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton btnCadastroDeProfessor = new JButton("Cadastro de Professor");
		btnCadastroDeProfessor.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
				CadastroProfessor cp = new CadastroProfessor();
				cp.iniciar();
			}
		});
		btnCadastroDeProfessor.setBounds(143, 68, 178, 23);
		contentPane.add(btnCadastroDeProfessor);
		
		JButton btnCadastroDeAluno = new JButton("Cadastro de aluno");
		btnCadastroDeAluno.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				    
					CadastroAluno ca = new CadastroAluno();
					ca.iniciar();
					
				}

				
				
		
		});
		btnCadastroDeAluno.setBounds(143, 129, 178, 23);
		contentPane.add(btnCadastroDeAluno);
		
		JButton btnCadastroDeFuncionario = new JButton("Cadastro de Funcionario");
		btnCadastroDeFuncionario.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				//istancia de funcionario
				Funcionario f = new Funcionario ();
				f.iniciar();
			}
		});
		btnCadastroDeFuncionario.setBounds(143, 183, 178, 23);
		contentPane.add(btnCadastroDeFuncionario);
		
		JButton btnCadastroDeObras = new JButton("Cadastro de Obras");
		btnCadastroDeObras.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				ViewCadastroObra co = new ViewCadastroObra ();
				co.iniciar();
			}
		});
		btnCadastroDeObras.setBounds(143, 242, 178, 23);
		contentPane.add(btnCadastroDeObras);
	}
}
